package consultan.vanke.com.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.OnClick;
import consultan.vanke.com.R;
import consultan.vanke.com.bean.HomeJumpBean;
import consultan.vanke.com.constant.ConstantLibrary;
import consultan.vanke.com.event.MessageEvent;

public class HouseItemFragment extends BaseFragment {

    @BindView(R.id.rel_into)
    RelativeLayout relInto;
    @BindView(R.id.img_left)
    ImageView imgLeft;
    @BindView(R.id.img_right)
    ImageView imgRight;
    @BindView(R.id.linear_item1)
    LinearLayout linearItem1;
    @BindView(R.id.rel_music)
    RelativeLayout relMusic;
    @BindView(R.id.linear_item2)
    LinearLayout linearItem2;
    @BindView(R.id.linear_item3)
    LinearLayout linearItem3;
    @BindView(R.id.linear_item4)
    LinearLayout linearItem4;

    @Override
    protected void initViews() {

    }

    @Override
    protected void initDatas() {
    }

    @Override
    protected void initEvents() {

    }

    @Override
    protected View initContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return View.inflate(_mActivity, R.layout.house_item_fragment, null);
    }


    @OnClick({R.id.rel_into, R.id.linear_item1, R.id.rel_music, R.id.linear_item2, R.id.linear_item3, R.id.linear_item4})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rel_into:
                MessageEvent<HomeJumpBean> messageEvent = new MessageEvent<>();
                messageEvent.setData(new HomeJumpBean(ConstantLibrary.fangjkzFragment, ConstantLibrary.TYPE_TIME_OUT));
                EventBus.getDefault().post(messageEvent);
                break;
            case R.id.linear_item1:
                MessageEvent<HomeJumpBean> messageEvent1 = new MessageEvent<>();
                messageEvent1.setData(new HomeJumpBean(ConstantLibrary.cjFragment, ConstantLibrary.DONGTAIA1));
                EventBus.getDefault().post(messageEvent1);
                break;
            case R.id.linear_item2:
                MessageEvent<HomeJumpBean> messageEvent2 = new MessageEvent<>();
                messageEvent2.setData(new HomeJumpBean(ConstantLibrary.cjFragment, ConstantLibrary.DONGTAIA2));
                EventBus.getDefault().post(messageEvent2);
                break;
            case R.id.linear_item3:
                MessageEvent<HomeJumpBean> messageEvent3 = new MessageEvent<>();
                messageEvent3.setData(new HomeJumpBean(ConstantLibrary.cjFragment, ConstantLibrary.DONGTAIA3));
                EventBus.getDefault().post(messageEvent3);
                break;
            case R.id.linear_item4:
                MessageEvent<HomeJumpBean> messageEvent4 = new MessageEvent<>();
                messageEvent4.setData(new HomeJumpBean(ConstantLibrary.cjFragment, ConstantLibrary.DONGTAIA4));
                EventBus.getDefault().post(messageEvent4);
                break;
            case R.id.rel_music:
                MessageEvent<HomeJumpBean> messageEvent5 = new MessageEvent<>();
                messageEvent5.setData(new HomeJumpBean(ConstantLibrary.musicFragment, ConstantLibrary.TYPE_TIME_OUT));
                EventBus.getDefault().post(messageEvent5);
                break;
        }
    }
}
